Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[P_UI] Added django settings for p_ui #5343

Merged
merged 14 commits into from
Aug 10, 2023

Conversation

wolflu05
Copy link
Contributor

@wolflu05 wolflu05 commented Jul 25, 2023

This PR improves a few things:

  • adds the ability to define normal Django settings that can be used in P_UI
  • adds the proxy option to the vite config, that way we the api and vite dev server run on the same url
  • added current url als default server
  • make host list configurable via Django settings
  • added option to don't render the host list edit button
  • use polling only for wsl

@wolflu05 wolflu05 added the Platform UI Related to the React based User Interface label Jul 25, 2023
Copy link
Member

@matmair matmair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

InvenTree/config_template.yaml Show resolved Hide resolved
InvenTree/web/templatetags/spa_helper.py Outdated Show resolved Hide resolved
src/frontend/src/components/forms/AuthFormOptions.tsx Outdated Show resolved Hide resolved
src/frontend/vite.config.ts Show resolved Hide resolved
@matmair matmair mentioned this pull request Jul 25, 2023
src/frontend/src/main.tsx Outdated Show resolved Hide resolved
@wolflu05
Copy link
Contributor Author

wolflu05 commented Jul 27, 2023

@matmair Can you help me here with the remaining requests from your comments?

@netlify
Copy link

netlify bot commented Jul 27, 2023

Deploy Preview for inventree ready!

Name Link
🔨 Latest commit 4b61a34
🔍 Latest deploy log https://app.netlify.com/sites/inventree/deploys/64c2dfc3680ff0000872a3a3
😎 Deploy Preview https://deploy-preview-5343--inventree.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

src/frontend/src/main.tsx Outdated Show resolved Hide resolved
@wolflu05
Copy link
Contributor Author

wolflu05 commented Jul 27, 2023

Would be ready for merge from my POV, I added the translating commands to the netlify build process so that the ui previews correctly translated.

@matmair
Copy link
Member

matmair commented Aug 5, 2023

@SchrodingersGat this would be ready for review and merge

@wolflu05
Copy link
Contributor Author

@SchrodingersGat just a gently ping on this pr.

@SchrodingersGat
Copy link
Member

@wolflu05 thanks for the reminder :)

Can you run me through how the settings get from .py to .ts? Are they simply rendered into the index.html page?

If so, does this get rendered "live" by the server? What happens if the backend settings change?

@wolflu05
Copy link
Contributor Author

Are they simply rendered into the index.html page?

Yes, they get rendered into the index.html page accessible on the global window object.

If so, does this get rendered "live" by the server? What happens if the backend settings change?

Settings change in the config file/env variable requires a server restart until the new settings are available. Due to the implementation from @matmair the server list settings only get changed if they are not already saved in the local storage. So you need to clean your local storage until the new server list takes affect or use a new private tab for testing each time.

@SchrodingersGat
Copy link
Member

Ok, happy with that. Thanks for getting this up and running :)

@SchrodingersGat SchrodingersGat merged commit 89795f6 into inventree:master Aug 10, 2023
@wolflu05 wolflu05 deleted the pui/server-settings branch August 10, 2023 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform UI Related to the React based User Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants